-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix compilation for Android and clean up _FILE_OFFSET_BITS #if-ery #69
Conversation
… macro _FILE_OFFSET_BITS.
…f_t limit. This check is especially useful on 32-bit systems which have no support for 64-bit file offsets (like older Android).
Thanks for the fixes. Which release of boost will this be available in? Will we have to wait for a 1.67 or can we get it in a hotfix 1.66.1? |
IMO, 1.66.1 is highly unlikely since 1.67 is on the way. I would hope someone with permissions will be able to merge it to develop and then to master before 1.67 is out, but no guarantees on that. |
This doesn't work with toolchains 21, 22 and 23, failing with error: C:\Android\toolchain21\bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../include/c++/4.9.x\cstdio:107:11: error: no member named 'fgetpos' in the global namespace
using ::fgetpos;
~~^
C:\Android\toolchain21\bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../include/c++/4.9.x\cstdio:117:11: error: no member named 'fsetpos' in the global namespace
using ::fsetpos;
~~^
2 errors generated. Changing the guard to See also this documentation that mentions API 24 is the first API that has all functions included in |
@MaartenBent, thanks for the heads up. The issue with It means that the issue still exists for Android APIs 21-23 on:
@MaartenBent, judging from you error messages, you are using gnustl. @MaartenBent, I agree, it's better to change the guard to It's possible to get 64-bit |
It compiles with android API level 19 and the verification if the file is not to big for resizing does indeed looks like a good fix, so I can execute my App on an Android with a higher API level (with 64-Bit support). With the last change, is this really sure that this is compiling with gnustl and API level 24? And when I check the Roadmap from Android they planned:
So Q2/2018 it's not far away... gnustl will be removed. |
For me it compiles successfully with API 21 and API 24. I do not define the stl when creating the toolchain so gnustl is used as default.
This doesn't work because
After moving |
After you included a system header, it's already too late to define |
Patch from boostorg#69 multiple commits, but head at boostorg/filesystem@3d3d504 Author: Alexei Khlebnikov <alexei.khlebnikov@gmail.com> Also see boostorg#65 boostorg#67
Looks good to me. If @Beman doesn't object, I'll merge that in a few days. |
Hurrah! :) Thanks for the merging! |
This pull requests cleans up
_FILE_OFFSET_BITS
#if-ery inoperations.cpp
, fixes compilation with new Android NDKs for old Android APIs (issue #65) and, thanks to @Lastique's patch, provides better error checking inresize_file()
function.Differences from other pull requests, like #52 and #67:
, which may eventually lead to #if-ery like
, I am making attempt to clean the mess and provide "flat" #if-ery like
During the cleanup, it turns out the either
_FILE_OFFSET_BITS
, or__USE_FILE_OFFSET64
, or both (!) is always defined, thus it is possible to greatly simplify the #if-ery.I am checking if
__ANDROID_API__
is defined. Reason: older Android NDKs, that use non-unified headers, do not define__ANDROID_API__
.Unlike operations: Don't set _FILE_OFFSET_BITS for older Android versions #52, I am including @Lastique's patch for
resize_file()
from Don't define _FILE_OFFSET_BITS=64 on Google Android NDK up to API level 21 #67.Unlike Don't define _FILE_OFFSET_BITS=64 on Google Android NDK up to API level 21 #67, I do not define
_FILE_OFFSET_BITS
if compiling with Crystax Android NDK. The reason is that I haven't found any proof that Crystax will somehow provide 64-bit truncate for Android APIs < 21. On the contrary, I found that on Crystaxoff_t
is 32-bit: https://github.com/crystax/android-platform-bionic#lp32-abi-bugs.